FROM 99fu.cn:5000/ubuntu/jdk:1.7

# last modified at 2016-11-08
MAINTAINER 99fu <958177388@qq.com>

ENV CATALINA_HOME /usr/local/program/tomcat
ENV TOMCAT_MAJOR_VERSION 7
ENV TOMCAT_VERSION 7.0.55
ENV APP_DIR ${CATALINA_HOME}/webapps/

COPY apache-tomcat-7.0.55.tar.gz apache-tomcat-7.0.55.tar.gz

ADD scripts /scripts

RUN chmod +x /scripts/start
RUN chmod +x /scripts/create_tomcat_admin_user




RUN tar zxf apache-tomcat-*.tar.gz && \
    rm apache-tomcat-*.tar.gz && \
    mkdir -p /usr/local/program &&\
    mv apache-tomcat* /usr/local/program/tomcat 

#RUN DEBIAN_FRONTEND=noninteractive apt-get install -y wget &&\
#  wget http://archive.apache.org/dist/tomcat/tomcat-$TOMCAT_MAJOR_VERSION/v$TOMCAT_VERSION/bin/apache-tomcat-$TOMCAT_VERSION.tar.gz &&\
# tar -xvf apache-tomcat*.tar.gz &&\
#  rm apache-tomcat*.tar.gz &&\
#  mkdir -p /usr/local/program &&\
#  mv apache-tomcat* /usr/local/program/tomcat

VOLUME ["/usr/local/program/tomcat/logs"]

EXPOSE 8080 443

#CMD ["/scripts/start"]
ENTRYPOINT ["/scripts/start"]

ONBUILD ADD . ${APP_DIR}
